
<div class='fui-page-group' ng-if="pagedata.op == 'main'">
<div class='fui-page  fui-page-current'>
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">商户中心</div>
		<div class="fui-header-right"></div>
	</div>
	<div class='fui-content member-page navbar'>
		<div class="fui-list-group merchgroup">
			<div class="fui-list jump">
                <a class="fui-list-media">
                    <img class="round" src="{{tomedia(pagedata.info.logo) || '../core/resource/images/nopic.jpg'}}" />
                </a>
                <div  ng-click="access_json('jy_merch/manage.login/')" class="fui-list-inner">
                    <div class="title">{{pagedata.info.title || '商户名称'}}</div>
					<div class="title" style="font-size:0.65rem">电话：{{pagedata.info.phone}}</div>
                </div>
				
                <a class="jump" href="javascript:;" ng-click="access_json('jy_cmso2o/merchants/set')">
					<i class="icon jinyunicon icon-set" style="width: 2rem; text-align: center;"></i>
				</a>
            </div>
		</div>
		
		<!--<div class="weui_cells weui_cells_access">
            <a class="weui_cell" href="javascript:;" >
                <div class="weui_cell_hd"><i class="icon jinyunicon icon-qrcode" style="font-size:0.9rem"></i></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <span>商户二维码</span>
                </div>
                <div class="weui_cell_ft"></div>
            </a>
			<img class="round" src="{{tomedia(pagedata.info.ewm) || '../core/resource/images/nopic.jpg'}}" />
        </div> -->
		<div ng-include="sys_html('_footer')"></div>
	</div>
</div>
</div>
<div class="fui-page fui-page-current" ng-if="pagedata.op == 'ruzhu'">
	<div class="fui-header">
			<div class="fui-header-left" onclick="window.history.go(-1);">
				<a class="back"></a>
			</div>
			<div class="title">申请入驻</div>
			<div class="fui-header-right"></div>
	</div>
	<div class="fui-content member-page" style="margin-bottom:2.5rem">
				<div class="fui-list-group merchgroup" style="padding:0.5rem">
							<div class="weui_cell_hd"><label class="weui_label">商户logo</label></div>
							<div class="fui-list jump">
								<a class="fui-list-media" ng-if="pagedata.info.logo">
									<img class="round" src="{{tomedia(pagedata.info.logo) || '../core/resource/images/nopic.jpg'}}" />
								</a>
								<a class="fui-list-media weui_uploader_input_wrp">
									<input class="weui_uploader_input" ng-click="image(pagedata.info,'logo')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
								</a>
							</div>
							
				</div>
		<div class="weui_cells weui_cells_form">
			  <div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">商户名称</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.info.title" placeholder="请输入商户名称">
                </div>
            </div>
            <div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">联系电话</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.info.phone" placeholder="请输入联系电话">
                </div>
            </div> 
			<div class="weui_cell">
                <div class="weui_cell_hd"><label for="" class="weui_label">详细地址</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" ng-model="pagedata.info.address" type="text" value="" placeholder="">
                </div>
                
			</div>
			<div class="weui_cell weui_cell_select">
					<div class="weui_cell_hd" style="width:2rem">
						分类
					</div>
				   <div class="weui_cell_bd weui_cell_primary" style="padding:0.6rem 0.1rem">
                    <select class="weui_select" name="select" ng-model="pagedata.info.group_id" style="padding-right:0">
						<option value="" selected>一级分类</option>
						<option ng-repeat="v in pagedata.pcates" value="{{v.id}}">{{v.title}}</option>
                    </select>
					</div>
					<div class="weui_cell_bd weui_cell_primary" style="padding:0.6rem 0.1rem">
						<select class="weui_select" name="select" ng-model="pagedata.info.ccate" style="padding-right:0">
							<option value="" selected>二级分类</option>
							<option ng-repeat="v in pagedata.pcates[pagedata.info.group_id].ccates" value="{{v.id}}">{{v.title}}</option>
						</select>
					</div>
					<div class="weui_cell_bd weui_cell_primary" style="padding:0.6rem 0.1rem">
						<select class="weui_select" name="select" ng-model="pagedata.info.scate" style="padding-right:0">
							<option value="" selected>三级分类</option>
							<option ng-repeat="v in pagedata.pcates[pagedata.info.group_id].ccates[pagedata.info.ccate].scates" value="{{v.id}}">{{v.title}}</option>
						</select>
					</div>
			</div>
			<div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">url地址</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.info.url" placeholder="请输入url地址">
                </div>
            </div>
			<div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">详细</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.info.desc" placeholder="请输入详细信息">
                </div>
            </div>
			<label class="col-xs-12 col-sm-3 col-md-2 left-label" style="padding-right:0;padding-left:0" ng-init="checkobj(pagedata.info,'onlinetime')">选择时间段</label>
				<div class="col-xs-12 col-sm-8 col-lg-9" style="padding-right:0;padding-left:0">
					<div class="timebox">
								<ul class="list-unstyled timelist clockpicker" data-autoclose="true">
									<li class="input-group">
										<span class="input-group-addon">营业时间段</span>
										<input type="text" id="clockpickerstart" ng-model="pagedata.info.onlinetime.start" class="form-control starttime" value="pagedata.info.onlinetime.start}}">
										<span class="input-group-addon">-</span>
										<input type="text" id="clockpickerend" ng-model="pagedata.info.onlinetime.end" class="form-control endtime" value="pagedata.info.onlinetime.end}}">
									</li>
								</ul>
					</div>
				<div class="help-block"></div>
			</div>

			<label class="col-xs-12 col-sm-3 col-md-2 left-label" style="padding-right:0;padding-left:0">选择坐标</label>
			<div class="col-xs-12 col-sm-8 col-lg-9" style="padding-right:0;padding-left:0">
				<div class="row margin0">
					<div class="col-xs-4 col-sm-4" style="padding-left:0">
						<input type="text" ng-model="pagedata.info.lat_lng.lng" placeholder="经度"  class="form-control" />
					</div>
					<div class="col-xs-4 col-sm-4">
						<input type="text" ng-model="pagedata.info.lat_lng.lat" placeholder="纬度"  class="form-control" />
					</div>
					<div class="col-xs-4 col-sm-4">
						<a ng-click="tool.choose_location(pagedata.info,'lat_lng','lat_lng')" class="btn btn-default btn-default-o btn-sm" type="button">选择坐标</a>
					</div>
				</div>
			</div>
		</div>
	<div class="weui_btn_area">
		<a class="weui_btn weui_btn_primary" href="javascript:" ng-click="post(pagedata.info,'ruzhupost')">提交</a>
	</div>
</div>
</div>
<div ng-if="pagedata.op == 'check'">
	<div class="fui-content">
		
		<div class="content-empty">
			  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">您还未入驻</p>
		</div>
		<div class="weui_btn_area">
		 <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="access_json('/merchants/ruzhu')">申请入驻</a>
		</div>
		<div class="weui_btn_area">
				 <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="access_json('/index/')">返回列表</a>
		</div>
	</div>
</div>
<div class="fui-page" ng-if="pagedata.op == 'set'">
<div class="fui-header">
		<div class="fui-header-left" onclick="window.history.go(-1);">
            <a class="back"></a>
        </div>
		<div class="title">商户设置</div>
		<div class="fui-header-right"></div>
</div>
<div class="fui-content" style="margin-bottom:2.5rem">
	<div class="fui-cell-group">
			<div class='fui-cell'>
				<div class='fui-cell-label'>商户logo</div>
				<div class="fui-cell-label" ng-if="pagedata.info.logo" style="width:3.3rem;height:3.3rem;margin-right:0.3rem;background:url('{{tomedia(pagedata.info.logo) || '../core/resource/images/nopic.jpg'}}') no-repeat 50%;background-size: cover;"></div>
				 <div class="fui-cell-info">
					<div class="weui_uploader_input_wrp" href="javascript:;" ng-click="image(pagedata.info,'logo')" accept="image/jpg,image/jpeg,image/png,image/gif"></div>
				</div>
			</div>
			<div class='fui-cell'>
				<div class='fui-cell-label'>商户二维码</div>
				<div class="fui-cell-label" ng-if="pagedata.info.ewm" style="width:3.3rem;height:3.3rem;margin-right:0.3rem;background:url('{{tomedia(pagedata.info.ewm) || '../core/resource/images/nopic.jpg'}}') no-repeat 50%;background-size: cover;"></div>
				 <div class="fui-cell-info">
					<div class="weui_uploader_input_wrp" href="javascript:;" ng-click="image(pagedata.info,'ewm')" accept="image/jpg,image/jpeg,image/png,image/gif"></div>
				</div>
			</div>
	</div>
	<div class="weui_cells weui_cells_form">
				  <div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">商户名称</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="text" ng-model="pagedata.info.title" placeholder="请输入商户名称">
					</div>
				</div>
				<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">联系电话</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="text" ng-model="pagedata.info.phone" placeholder="请输入联系电话">
					</div>
				</div> 
				<div class="weui_cell">
					<div class="weui_cell_hd"><label for="" class="weui_label">详细地址</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" ng-model="pagedata.info.address" type="text" value="" placeholder="">
					</div>
					<div class="weui_cell_ft" ng-click="tool.choose_location(pagedata.info,'address','address')">
						<i class="icon jinyunicon icon-ditu"></i>
					</div>
				</div>
				<div class="weui_cell weui_cell_select">
					<div class="weui_cell_hd" style="width:2rem">
						分类
					</div>
				   <div class="weui_cell_bd weui_cell_primary" style="padding:0.6rem 0.1rem">
                    <select class="weui_select" name="select" ng-model="pagedata.info.group_id" style="padding-right:0">
						<option value="" selected>一级分类</option>
						<option ng-repeat="v in pagedata.pcates" value="{{v.id}}">{{v.title}}</option>
                    </select>
					</div>
					<div class="weui_cell_bd weui_cell_primary" style="padding:0.6rem 0.1rem">
						<select class="weui_select" name="select" ng-model="pagedata.info.ccate" style="padding-right:0">
							<option value="" selected>二级分类</option>
							<option ng-repeat="v in pagedata.pcates[pagedata.info.group_id].ccates" value="{{v.id}}">{{v.title}}</option>
						</select>
					</div>
					<div class="weui_cell_bd weui_cell_primary" style="padding:0.6rem 0.1rem">
						<select class="weui_select" name="select" ng-model="pagedata.info.scate" style="padding-right:0">
							<option value="" selected>三级分类</option>
							<option ng-repeat="v in pagedata.pcates[pagedata.info.group_id].ccates[pagedata.info.ccate].scates" value="{{v.id}}">{{v.title}}</option>
						</select>
					</div>
				</div>
				<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">商户网址</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="text" ng-model="pagedata.info.url" placeholder="请输入url地址">
					</div>
				</div>
				<div class="weui_cell weui_vcode">
					<div class="weui_cell_hd"><label class="weui_label">商户描述</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<input class="weui_input" type="text" ng-model="pagedata.info.desc" placeholder="请输入详细信息">
					</div>
				</div>
				<label class="col-xs-12 col-sm-3 col-md-2 left-label" style="padding-right:0;padding-left:0" ng-init="checkobj(pagedata.info,'onlinetime')">营业时间段</label>
						<div class="col-xs-12 col-sm-8 col-lg-9" style="padding-right:0;padding-left:0">
							<div class="timebox">
										<ul class="list-unstyled timelist clockpicker" data-autoclose="true">
											<li class="input-group">
												<span class="input-group-addon">时间段</span>
												<input type="text" id="clockpickerstart" ng-model="pagedata.info.onlinetime.start" class="form-control starttime" value="pagedata.info.onlinetime.start}}">
												<span class="input-group-addon">-</span>
												<input type="text" id="clockpickerend" ng-model="pagedata.info.onlinetime.end" class="form-control endtime" value="pagedata.info.onlinetime.end}}">
											</li>
										</ul>
							</div>
						<div class="help-block"></div>
						</div>
					<label class="col-xs-12 col-sm-3 col-md-2 left-label" style="padding-right:0;padding-left:0">选择坐标</label>
					<div class="col-xs-12 col-sm-8 col-lg-9" style="padding-right:0;padding-left:0">
						<div class="row row-fix">
							<div class="col-xs-4 col-sm-4">
							<input type="text" ng-model="pagedata.info.lat_lng.lng" placeholder="经度"  class="form-control" />
							</div>
							<div class="col-xs-4 col-sm-4">
								<input type="text" ng-model="pagedata.info.lat_lng.lat" placeholder="纬度"  class="form-control" />
							</div>
							<div class="col-xs-4 col-sm-4">
								<a ng-click="tool.choose_location(pagedata.info,'lat_lng')" class="btn btn-default btn-default-o btn-sm" type="button">选择坐标</a>
							</div>
						</div>
					</div>
				</div>	
	
		<div class="weui_btn_area">
				 <a class="weui_btn weui_btn_primary" href="javascript:" ng-click="post(pagedata.info,'post')">提交</a>
		</div>
</div>
</div>
<script type="text/javascript">
require(['angular.sanitize','clockpicker'], function(angular, $, _){
	$('.starttime').clockpicker({
		autoclose: true,
		afterDone: function() {
			var value=document.getElementById("clockpickerstart").value;  
			if(!value){
				value='8:00';
			}
			scope.pagedata.info.onlinetime.start = value;
        },
	});
	$('.endtime').clockpicker({
		align:'right',
		autoclose: true,
		afterDone: function() {
			   var value=document.getElementById("clockpickerend").value;
			   if(!value){
					value='18:00';
				}
				scope.pagedata.info.onlinetime.end = value;
				console.log(scope.pagedata.info.onlinetime.end)
        },
	});
});
</script>
<script type="text/javascript">
if (scope.pagedata.op == 'ruzhu' || scope.pagedata.op == 'set'){
	window.scope.location(function(res){
			console.log(res)
			scope.$evalAsync(function(){
				scope.pagedata.info.lat_lng=scope.pagedata.info.lat_lng?scope.pagedata.info.lat_lng:res.lat_lng
				scope.pagedata.info.address = res.address;
			});
	});
}
</script>